<?php
echo '<?xml version="1.0" encoding="utf-8" ?><?xml-stylesheet type="text/css" href="'.Yii::app()->request->baseUrl.'/css/front/sitemaps.css"?>';
$modifiedDay = date('Y-m-d');
?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.sitemaps.org/schemas/sitemap/0.9 http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd">
<?php
    if($categories){
        foreach($categories as $category)
        {
            echo '<url>
                    <loc>http://'.$_SERVER['HTTP_HOST'].$category->buildCategoryUrl().'</loc>
                    <lastmod>'.$modifiedDay.'</lastmod>
                    <changefreq>daily</changefreq>
                    <priority>0.8</priority>
                </url>';
        }
    }
    if($articles){
        foreach($articles as $article)
        {
            echo '<url>
                    <loc>http://'.$_SERVER['HTTP_HOST'].$article->buildArticleUrl().'</loc>
                    <lastmod>'.$modifiedDay.'</lastmod>
                    <changefreq>daily</changefreq>
                    <priority>0.8</priority>
                </url>';
        }
    }

?>
</urlset>